package cn.bdqn.controller;

import cn.bdqn.pojo.Attributeson;
import cn.bdqn.service.AttributesonService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/attributeson")
public class AttributesonController {
    @Resource
    private AttributesonService attributesonService;

    @RequestMapping("showA")
    public  String showA( Model model){
        List<Attributeson> attributeson = attributesonService.showA();
        model.addAttribute("attributeson",attributeson);
        return "property-Settings-list";
    }

    //新增职位信息
    @RequestMapping("addA")
    public String addA(Attributeson a){
        int flag = attributesonService.addA(a);
        if(flag == 1) {
            return "redirect:/attributeson/showA";
        }else {
            return "property-Settings-list-add";
        }
    }
}
